#include "widget001.h"
#include "ui_widget001.h"




int globl_test03(int x, int y, int z)
{
    qDebug()<< " glob03 in :" << x <<y<<z;
    return x+y+z;

}



Widget001::Widget001(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget001)
{
    ui->setupUi(this);


   // test001();

    func_p = &Widget001::test02;


    func_p222=globl_test03;


    func_p333= aa;


}

Widget001::~Widget001()
{
    delete ui;
}



int Widget001::test02(int x, int y)
{
    qDebug()<< " test02 in :" << x <<y;
    return 1;

}


void Widget001::on_pushButton_clicked()
{
    int ret= (this->*func_p)(3,8);
    qDebug()<< " test02 return :" << ret;


    int ret222= (func_p222)(3,8,5);
    qDebug()<< " test03 return :" << ret222;


    int ret333= (func_p333)(9);
    qDebug()<< " test333 return :" << ret333;


}



void Widget001::test001()
{
    qDebug()<< " in";

    uint16_t a=0x5;

    uint16_t *p=&a;

qDebug()<< " a"<<a;
qDebug()<< " add:"<<p;
qDebug()<< " add2:"<<p+1;

qDebug()<< " add3:"<<*p;

qDebug()<< " add4:"<<*(p+1);




short bb[]={0x10,0x11,0x12,0x13};

qDebug()<< " bb1 :"<<bb[0];

short *bbp=bb;

qDebug()<< " bb2 :"<<*bbp;
qDebug()<< " bb3 :"<<*(bbp+1);
qDebug()<< " bb4 :"<<*(bbp+2);

}



